using System.IO;
using System.Web;
using System.Windows.Forms;

namespace Smallpointer.Configuration.Common
{
    public class ConfigurationUtil
    {
        public static string GetFullFilename(string virFilename)
        {
            var filename = string.Empty;
            if (HttpContext.Current != null)
            {
                filename = HttpContext.Current.Request.ApplicationPath + "/" + virFilename;
            }
            else
            {
                filename = Application.StartupPath + "/" + filename;
            }
            var fileinfo = new FileInfo(filename);
            if (!fileinfo.Exists)
            {
                filename = string.Empty;
            }
            else
            {
                filename = fileinfo.FullName;
            }
            return filename;
        }
    }
}